import 'package:factoryside/bean/factory_prod_entity.dart';

factoryProdEntityFromJson(FactoryProdEntity data, Map<String, dynamic> json) {
	if (json['Id'] != null) {
		data.id = json['Id'] is String
				? int.tryParse(json['Id'])
				: json['Id'].toInt();
	}
	if (json['BrandCategoryID'] != null) {
		data.brandCategoryID = json['BrandCategoryID'] is String
				? int.tryParse(json['BrandCategoryID'])
				: json['BrandCategoryID'].toInt();
	}
	if (json['BrandID'] != null) {
		data.brandID = json['BrandID'] is String
				? int.tryParse(json['BrandID'])
				: json['BrandID'].toInt();
	}
	if (json['BrandName'] != null) {
		data.brandName = json['BrandName'].toString();
	}
	if (json['UserID'] != null) {
		data.userID = json['UserID'].toString();
	}
	if (json['CategoryID'] != null) {
		data.categoryID = json['CategoryID'] is String
				? int.tryParse(json['CategoryID'])
				: json['CategoryID'].toInt();
	}
	if (json['CategoryName'] != null) {
		data.categoryName = json['CategoryName'].toString();
	}
	if (json['SubCategoryID'] != null) {
		data.subCategoryID = json['SubCategoryID'] is String
				? int.tryParse(json['SubCategoryID'])
				: json['SubCategoryID'].toInt();
	}
	if (json['SubCategoryName'] != null) {
		data.subCategoryName = json['SubCategoryName'].toString();
	}
	if (json['ProductTypeID'] != null) {
		data.productTypeID = json['ProductTypeID'] is String
				? int.tryParse(json['ProductTypeID'])
				: json['ProductTypeID'].toInt();
	}
	if (json['ProductTypeName'] != null) {
		data.productTypeName = json['ProductTypeName'].toString();
	}
	if (json['CourseCount'] != null) {
		data.courseCount = json['CourseCount'];
	}
	if (json['Imge'] != null) {
		data.imge = json['Imge'];
	}
	if (json['IsUse'] != null) {
		data.isUse = json['IsUse'].toString();
	}
	if (json['ProdModelID'] != null) {
		data.prodModelID = json['ProdModelID'] is String
				? int.tryParse(json['ProdModelID'])
				: json['ProdModelID'].toInt();
	}
	if (json['ProdModel'] != null) {
		data.prodModel = json['ProdModel'].toString();
	}
	if (json['UseNum'] != null) {
		data.useNum = json['UseNum'] is String
				? int.tryParse(json['UseNum'])
				: json['UseNum'].toInt();
	}
	if (json['page'] != null) {
		data.page = json['page'] is String
				? int.tryParse(json['page'])
				: json['page'].toInt();
	}
	if (json['limit'] != null) {
		data.limit = json['limit'] is String
				? int.tryParse(json['limit'])
				: json['limit'].toInt();
	}
	if (json['Explains'] != null) {
		data.explains = json['Explains'];
	}
	if (json['CommonFaults'] != null) {
		data.commonFaults = json['CommonFaults'];
	}
	if (json['Version'] != null) {
		data.version = json['Version'] is String
				? int.tryParse(json['Version'])
				: json['Version'].toInt();
	}
	return data;
}

Map<String, dynamic> factoryProdEntityToJson(FactoryProdEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['Id'] = entity.id;
	data['BrandCategoryID'] = entity.brandCategoryID;
	data['BrandID'] = entity.brandID;
	data['BrandName'] = entity.brandName;
	data['UserID'] = entity.userID;
	data['CategoryID'] = entity.categoryID;
	data['CategoryName'] = entity.categoryName;
	data['SubCategoryID'] = entity.subCategoryID;
	data['SubCategoryName'] = entity.subCategoryName;
	data['ProductTypeID'] = entity.productTypeID;
	data['ProductTypeName'] = entity.productTypeName;
	data['CourseCount'] = entity.courseCount;
	data['Imge'] = entity.imge;
	data['IsUse'] = entity.isUse;
	data['ProdModelID'] = entity.prodModelID;
	data['ProdModel'] = entity.prodModel;
	data['UseNum'] = entity.useNum;
	data['page'] = entity.page;
	data['limit'] = entity.limit;
	data['Explains'] = entity.explains;
	data['CommonFaults'] = entity.commonFaults;
	data['Version'] = entity.version;
	return data;
}